<div class="product-select-modal">
    <p-table [value]="products" [(selection)]="selectedProducts" dataKey="id" [paginator]="true" [rows]="10"
      [totalRecords]="totalCount" (onPage)="onPageChange($event)" [lazy]="true">
      <ng-template pTemplate="header">
        <tr>
          <th style="width: 3rem"><p-tableHeaderCheckbox></p-tableHeaderCheckbox></th>
          <th>货品名称</th>
          <th>货品编号</th>
          <th>规格型号</th>
          <th>单位</th>
          <th>当前库存</th>
        </tr>
      </ng-template>
      <ng-template pTemplate="body" let-product>
        <tr>
          <td><p-tableCheckbox [value]="product"></p-tableCheckbox></td>
          <td>{{ product.productName }}</td>
          <td>{{ product.productCode }}</td>
          <td>{{ product.model }}</td>
          <td>{{ product.unit }}</td>
          <td>{{ product.quantityOnHand }}</td>
        </tr>
      </ng-template>
    </p-table>
  
    <div class="p-dialog-footer">
      <button pButton type="button" label="取消" class="p-button-secondary" (click)="ref.close()"></button>
      <button pButton type="button" label="确认" class="p-button-primary" (click)="selectProduct()"></button>
    </div>
  </div>